<template>
  <!-- 
    1:加入一个icon图片,用于全屏
    2:将该组件全局注册
    3:加入到navbar组件上相应位置
    4:实现点击全屏切换(插件)
 -->
  <svg-icon iconClass="fullscreen" @click="svgClick"></svg-icon>
</template>
<script>
import screenfull from 'screenfull'
export default {
  name: 'FullControl',
  methods: {
    svgClick () {
      window.console.log(screenfull)
      if (!screenfull.isEnabled) {
        this.$message.error('该浏览器不支持全屏')
        return
      }
      screenfull.toggle()
    }
  }
}
</script>
<style></style>
